<!DOCTYPE html>
<html>
    <head>
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'workflowUser.label', default: 'WorkflowUser')}" />
        <title>权限</title>
    </head>
    <body>
      <div class="small-header">
          <div class="hpanel">
              <div class="panel-body">
                  <div id="hbreadcrumb" class="pull-right">
                      <ol class="hbreadcrumb breadcrumb">
                          <li>CINDATA PLS</li>
                          <li>
                              新增权限
                          </li>
                          <li class="active">
                              <span>新增权限</span>
                          </li>
                      </ol>
                  </div>
                  <h2 class="font-light m-b-xs">
                          新增权限
                      </h2>
              </div>
          </div>
      </div>
      <div class="content animate-panel">
          <div class="row">
              <div class="hpanel hblue">
                  <div class="panel-heading">
                      新增权限
                  </div>
                  <div class="panel-body">
                      <g:form action="save" class="form-horizontal">
                      <g:if test="${flash.message}">
                      <div class="message" role="status">${flash.message}</div>
                      </g:if>
                      <g:hasErrors bean="${this.workflowUser}">
                      <ul class="errors" role="alert">
                          <g:eachError bean="${this.workflowUser}" var="error">
                          <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
                          </g:eachError>
                      </ul>
                      </g:hasErrors>

                          <g:textField class="form-control hidden" type="text" name="targetUri" id="targetUri" value="${params.targetUri}"/>
                          <g:textField name="stage.id" id="stage" value="${this.workflowUser?.stage?.id}" class="hide" />
                          
                          <div class="form-group">
                              <label class="col-md-3 control-label is-required">角色</label>
                              <div class="col-md-3">
                                  <g:select class="form-control" name="role.id" id="role" value="${this.workflowUser?.role}" from="${com.cindata.Role.list()}" optionKey="id" optionValue="name"></g:select>
                              </div>
                          </div>

                          <div class="hr-line-dashed"></div>
                          <div class="form-group">
                              <label class="col-md-3 control-label is-required">权限</label>
                              <div class="col-md-3">
                                  <g:select class="form-control" name="authority.id" id="authority" value="${this.workflowUser?.authority}" from="${com.cindata.WorkflowAuthority.list()}" optionKey="id" optionValue="name"></g:select>
                              </div>
                          </div>

                          <div class="hr-line-dashed"></div>
                          <div class="form-group">
                              <div class="col-md-3 col-md-offset-3">
                                  <g:submitButton class="btn btn-info" name="update" value="添加" />
                              </div>
                          </div>
                      </g:form>
                  </div>
              </div>
          </div>
      </div>

    </body>
</html>
